/*
 * avrio.c
 *
 *  Created on: 2012/1/20
 *      Author: kc.chang
 */

#include <stdio.h>

unsigned char DDRD;
unsigned char PORTD;
unsigned char PIND;
unsigned char PD0 = 0;
unsigned char PD1 = 1;
unsigned char PD2 = 2;
unsigned char PD3 = 3;
unsigned char PD4 = 4;
unsigned char PD5 = 5;
unsigned char PD6 = 6;
unsigned char PD7 = 7;

unsigned char DDRC;
unsigned char PORTC;
unsigned char PINC;
unsigned char PC0 = 0;
unsigned char PC1 = 1;
unsigned char PC2 = 2;
unsigned char PC3 = 3;
unsigned char PC4 = 4;
unsigned char PC5 = 5;
unsigned char PC6 = 6;
unsigned char PC7 = 7;

unsigned char DDRB;
unsigned char PORTB;
unsigned char PINB;
unsigned char PB0 = 0;
unsigned char PB1 = 1;
unsigned char PB2 = 2;
unsigned char PB3 = 3;
unsigned char PB4 = 4;
unsigned char PB5 = 5;
unsigned char PB6 = 6;
unsigned char PB7 = 7;

unsigned char OSCCAL = 0;

unsigned char TCCR0;
unsigned char TCNT0;
unsigned char TIFR;
unsigned char TIMSK;
unsigned char CS02 = 2;
unsigned char CS01 = 1;
unsigned char CS00 = 0;
unsigned char TOV0 = 1;
unsigned char TOIE0 = 1;



long int delay_loop_num=0;
//-----------------------------------------------------------------------------
void _delay_loop_2(int i)
{
	delay_loop_num+=i;
}
//-----------------------------------------------------------------------------
void PortD_Out(unsigned char x)
{
	printf("%ld,0x%x\n", delay_loop_num, x);
	fflush(stdout);
}
//-----------------------------------------------------------------------------
